// 首页相关 API
// 使用统一的请求封装

import request from '@/utils/request';

// 获取首页统计数据
export function getHomeStatistics(userId) {
  return request({
    url: '/mobile/home/statistics',
    method: 'GET',
    data: { userId: userId }
  });
}

// 获取宠物概览信息
export function getPetOverview(userId) {
  return request({
    url: '/mobile/home/pets/overview',
    method: 'GET',
    data: { userId: userId }
  });
}

// 获取最近活动记录
export function getRecentActivities(params = {}) {
  return request({
    url: '/mobile/home/activities',
    method: 'GET',
    data: params
  });
}

// 获取系统通知
export function getSystemNotifications(params = {}) {
  return request({
    url: '/mobile/home/notifications',
    method: 'GET',
    data: params
  });
}

// 标记通知为已读
export function markNotificationRead(notificationId) {
  return request({
    url: `/mobile/notifications/${notificationId}/read`,
    method: 'PUT',
    header: {
      isToken: true
    }
  });
}

// 获取天气信息
export function getWeatherInfo(location) {
  return request({
    url: '/mobile/home/weather',
    method: 'GET',
    data: { location }
  });
}